package com.starsea.book.ui.newpage.weidget.banner.transformer

import android.view.View
import androidx.core.view.ViewCompat

/**
 * 描述:
 */
class AccordionPageTransformer : BannerPageTransformer() {
  override fun handleInvisiblePage(view: View, position: Float) {}
  override fun handleLeftPage(view: View, position: Float) {
    ViewCompat.setPivotX(view, view.width.toFloat())
    ViewCompat.setScaleX(view, 1.0f + position)
  }

  override fun handleRightPage(view: View, position: Float) {
    ViewCompat.setPivotX(view, 0f)
    ViewCompat.setScaleX(view, 1.0f - position)
    ViewCompat.setAlpha(view, 1f)
  }
}